package com.game.view.layer.loadingBar
{
	import com.dusk.net.AssetLoader;
	import com.dusk.util.ResUtil;
	import com.dusk.util.TextUtil;
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormatAlign;
	
	public class LoadingBar2 extends LoadingBarBase
	{
		
		public function LoadingBar2()
		{
			super();
		}
		
		public var bar:MovieClip;
		private var numTxt:TextField;
		
		override protected function beforeAdded():void
		{
			var mc:MovieClip = ResUtil.getLayerView("LoadingBar2") as MovieClip;
			bar = mc.getChildByName("bar") as MovieClip;
			bar.gotoAndStop(1);
			numTxt = TextUtil.creatTextField("/99",TextUtil.UNIVERSAL_FONT,25,TextFormatAlign.RIGHT,0xFFFFFF);
			with(numTxt)
			{
				x = 165;
				y = 150;
				width = 70;
				height = 35;
			}
			addChild(mc);
			addChild(numTxt);
		}
		
		override protected function setProcess(data:Object):void
		{
			bar.gotoAndStop(data.curPercent);
			numTxt.text = data.curNum.toString() + "/" + data.totalNum.toString();
		}
	}
}
